﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StoragePeriod.IDAL.FoodTesting;
using StoragePeriod.DALFactory;
using StoragePeriod.Model.FoodTesting;

namespace StoragePeriod.BLL.FoodTesting
{
    /// <summary>
    /// Vc含量检测操作
    /// </summary>
    public class T_VcData
    {
        I_VcData dal = new DataAccess<I_VcData>().CreateInstance("FoodTesting.D_VcData");

        /// <summary>
        /// 获取Vc含量检查实体
        /// </summary>
        /// <param name="eVcData">查询ID</param>
        /// <returns>返回对应的实体</returns>
        public E_VcData GetVcDataEntityById(E_VcData eVcData)
        {
            return dal.GetVcDataEntityById(eVcData);
        }

        /// <summary>
        /// 根据原料ID和检测时间 删除检测记录
        /// </summary>
        /// <param name="eVcData">要删除的检测记录</param>
        /// <returns></returns>
        public int RemoveByVcTime(E_VcData eVcData)
        {
            return dal.RemoveByVcTime(eVcData);
        }

        /// <summary>
        /// 根据原料ID 和检测时间 获取所有的检测记录
        /// </summary>
        /// <param name="eVcData">要获取的检测记录</param>
        /// <returns></returns>
        public List<E_VcData> GetVcDataListByVcTime(E_VcData eVcData)
        {
            return dal.GetVcDataListByVcTime(eVcData);
        }

         /// <summary>
        /// 删除某一次检测记录
        /// </summary>
        /// <param name="eVcData">要删除的检测记录</param>
        /// <returns></returns>
        public int RemoveByFoodNum(E_VcData eVcData)
        {
            return dal.RemoveByFoodNum(eVcData);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(E_VcData eVcData)
        {
            return dal.Add(eVcData);
        }

        /// <summary>
        /// 获取最后一次检测的数据
        /// </summary>
        /// <returns></returns>
        public E_VcData GetModelByTimeDesc(E_VcData eVcData)
        {
            return dal.GetModelByTimeDesc(eVcData);
        }
    }
}
